home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4369 < prev    next >
Encoding:
Text File  |  1996-08-06  |  954 b   |  41 lines

  1. Path: newshost.vvm.com!news
  2. From: Arun Nair <arun@ns.vvm.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Help! Allocating 3 dimensional or greater arrays in C++
  5. Date: Mon, 29 Jan 1996 05:50:23 -0800
  6. Organization: VVM, Inc.
  7. Message-ID: <310CD09F.1D71@ns.vvm.com>
  8. NNTP-Posting-Host: k1slip8.vvm.com
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0b5 (Win16; I)
  13.  
  14. I have been trying to allocate a 3 dimensional array in C++.
  15.  
  16. void main()
  17. {
  18.     int *matrix;
  19.     int **pmatrix = &matrix;
  20.     int ***ppmatrix = &pmatrix;
  21.     int size;
  22.     matrix = new int[10];
  23.     pmatrix = new matrix[10];
  24.     ppmatrix = new pmatrix[10];
  25.     .
  26.     .
  27.     .
  28.     .
  29.  
  30.     What is wrong with the above code?  I have searched the
  31. C++ faqs and a couple of other books for this answer but so far
  32. I have not been able to get an answer.  If any of you can help me
  33. in this regard I would be grateful. 
  34.  
  35. Thanks in advance,
  36.  
  37. with best regards,
  38.  
  39. Arun
  40. (arun@ns.vvm.com)
  41.